<?php
class AclComponent{
	var $controller;
	function initialize($controller){
		$controller->Acl=$this;
		$this->controller=&$controller;
	}
	function startup(){

	}
	function check($user,$action,$allowed_actions=null){
		if($user['Group']['id']==2){
			return true;
		}
		if($user==null){
			$allowed_actions=$this->controller->Auth->allowedActions;
			if(is_array($allowed_actions)){
				foreach($allowed_actions as $k=>$v){
					if($action==$v){
						return true;
					}
				}
			}
			return false;
		}
		if(substr($action,0,5)=='admin'){
			return false;
		}
		return true;
	}
}